import type { UserRecord } from './User';

export interface ArticleRecord {
  id: number;
  userId: number;
  // 存储路径
  filename: string;
  user?: UserRecord;
  tagIds: string; // array JSON
  headline: string; // 标题
  outline: string; // 摘要
  coverUrl: string;
  status: '0' | '1'; // 是否为草稿
  content: string; // 文章内容
  createTime: string;
  updateTime: string;
}

export enum ArticleStatusType {
  // 草稿
  Draft = '0',
  // 定稿
  Finalize = '1',
}

export const ArticleStatusTypeMap = {
  [ArticleStatusType.Draft]: {
    text: '草稿',
    status: 'error',
  },
  [ArticleStatusType.Finalize]: {
    text: '定稿',
    status: 'success',
  },
};
